package com.zeng.webmvc.threadlocal;

import org.eclipse.microprofile.config.Config;

/**
 * @author zyb
 * @date 2021-03-23 21:23
 */
public class ConfigThreadLocal {
    private static final ThreadLocal<Config> CONFIG_THREAD_LOCAL = new InheritableThreadLocal<>();

    public static void setConfig(Config config) {
        CONFIG_THREAD_LOCAL.set(config);
    }

    public static Config getConfig() {
        return CONFIG_THREAD_LOCAL.get();
    }

    public static void remove() {
        CONFIG_THREAD_LOCAL.remove();
    }
}
